package com.ymttest.database.model.mongo.query;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Field;

import com.ymatou.iapi.trading.ordersync.parameter.po.SubProduct;
import com.ymttest.database.model.annotation.Column;
import com.ymttest.database.model.annotation.Table;
import com.ymttest.database.mongo.config.OrderField;

/**
 * 订单所有信息汇总
 * Created by zhangyifan on 2016/12/8.
 */
public class Order {

	/**
	 * order
	 * 订单ID
	 */
	@Table("Ymt_Orders")
	@Column("iOrderId")
	@Id
	private Long id;

	/**
	 * 插入时间
	 */
	@Field(OrderField.TIME_MONGO_ADD)
	private Date timeMongoAdd;

	/**
	 * 更新时间
	 */
	@Field(OrderField.TIME_MONGO_UPDATE)
	private Date timeMongoUpdate;

	/**
	 * order
	 * 主单ID
	 */
	@Table("Ymt_Orders")
	@Column("iMainOrderId")
	@Field(OrderField.MAIN_ORDER_ID)
	private Long mainOrderId;

	/**
	 * order
	 * 买家
	 */
	@Table("Ymt_Orders")
	@Column("iUserId")
	@Field(OrderField.USER_ID)
	private Long userId;

	/**
	 * order
	 * 卖家
	 */
	@Table("Ymt_Orders")
	@Column("iBuyerid")
	@Field(OrderField.SELLER_ID)
	private Long sellerId;

	/**
	 * order
	 * 下单时间
	 */
	@Table("Ymt_Orders")
	@Column("dAddTime")
	@Field(OrderField.ADD_TIME)
	private Date addTime;

	/**
	 * order
	 * 交易ID
	 */
	@Table("Ymt_Orders")
	@Column(OrderField.TRADING_ID)
	@Field("trdId")
	private Integer tradingId;

	/**
	 * order
	 * 交易状态
	 */
	@Table("Ymt_Orders")
	@Column("iTradingStatus")
	@Field(OrderField.TRADING_STATUS)
	private Integer tradingStatus;

	/**
	 * order
	 * 接单时间
	 */
	@Table("Ymt_Orders")
	@Column("dAcceptTime")
	@Field("acpTm")
	private Date acceptTime;

	/**
	 * order
	 * 发货时间
	 */
	@Table("Ymt_Orders")
	@Column("dDispathTime")
	@Field(OrderField.DELIVERY_TIME)
	private Date deliveryTime;

	/**
	 * order
	 * 付款时间
	 */
	@Table("Ymt_Orders")
	@Column("dPaidTime")
	@Field(OrderField.PAID_TIME)
	private Date paidTime;

	/**
	 * order
	 * 收货时间
	 */
	@Table("Ymt_Orders")
	@Column("dConfirmedTime")
	@Field(OrderField.RECEIVE_TIME)
	private Date receiveTime;

	/**
	 * order
	 * 申请补款时间
	 */
	@Table("Ymt_Orders")
	@Column("dApplyPostPayTime")
	@Field(OrderField.APPLY_POST_TIME)
	private Date applyPostTime;

	/**
	 * order
	 * 补款时间
	 */
	@Table("Ymt_Orders")
	@Column("dPostPaidTime")
	@Field(OrderField.POST_TIME)
	private Date postTime;

	/**
	 * order
	 * 取消时间
	 */
	@Table("Ymt_Orders")
	@Column("dCancelTime")
	@Field(OrderField.CANCEL_TIME)
	private Date cancelTime;

	/**
	 * order
	 * 风控状态
	 */
	@Table("Ymt_Orders")
	@Column("iRiskVerifiedStatus")
	@Field(OrderField.RISK_STATUS)
	private Integer riskStatus;

	/**
	 * order
	 * 买家登陆ID
	 */
	@Table("Ymt_Orders")
	@Column("sBuyerLoginId")
	@Field(OrderField.USER_LOGIN)
	private String userLogin;

	/**
	 * order
	 * 卖家登陆ID
	 */
	@Table("Ymt_Orders")
	@Column("sSellerLoginId")
	@Field(OrderField.SELLER_LOGIN)
	private String sellerLogin;

	/**
	 * order
	 * 拼邮是否国内配送
	 */
	@Table("Ymt_Orders")
	@Column("bDomesticDelivered")
	@Field(OrderField.LOCAL_DELIVERY)
	private boolean localDelivery;

	/**
	 * order
	 * 是否删除
	 */
	@Table("Ymt_Orders")
	@Column("bDeleted")
	@Field(OrderField.DELETED)
	private boolean deleted;

	/**
	 * order
	 * 是否评价
	 */
	@Table("Ymt_Orders")
	@Column("bEvaluated")
	@Field(OrderField.EVALUATED)
	private boolean evaluated;

	/**
	 * order
	 * 是否预售
	 */
	@Table("Ymt_Orders")
	@Column("bPreSale")
	@Field(OrderField.PRE_SALE)
	private boolean preSale;

	/**
	 * order
	 * 旗子
	 */
	@Table("Ymt_O_OrderNote")
	@Column("iRemarkLevel")
	@Field(OrderField.REMARK_LEVEL)
	private Integer remarkLevel;

	/**
	 * order
	 * 自动取消小时
	 */
	@Table("Ymt_Orders")
	@Column("fAutoCancelOrderHours")
	@Field(OrderField.AUTO_CANCEL_HOUR)
	private BigDecimal autoCancelHour;

	/**
	 * order
	 * 是否贝海物流
	 */
	@Table("Ymt_Orders")
	@Column("bShippedByXlobo")
	@Field(OrderField.XLOBO)
	private boolean xlobo;

	/**
	 * order
	 * 平台优惠券
	 */
	@Table("Ymt_Orders")
	@Column("fYmtCouponAmount")
	@Field("ymtCopAmt")
	private BigDecimal ymtCouponAmount;

	/**
	 * order
	 * 平台优惠券码
	 */
	@Table("Ymt_Orders")
	@Column("sYmtCouponCode")
	@Field(OrderField.YMT_COUPON_CODE)
	private String ymtCouponCode;

	/**
	 * order
	 * 卖家优惠券
	 */
	@Table("Ymt_Orders")
	@Column("fSellerCouponAmount")
	@Field(OrderField.SELLER_COUPON_AMOUNT)
	private BigDecimal sellerCouponAmount;

	/**
	 * order
	 * 卖家优惠券码
	 */
	@Table("Ymt_Orders")
	@Column("sSellerCouponCode")
	@Field(OrderField.SELLER_COUPON_CODE)
	private String sellerCouponCode;

	/**
	 * order
	 * 卖家满减优惠
	 */
	@Table("Ymt_Orders")
	@Column("fSellerPromotionAmount")
	@Field(OrderField.SELLER_PROMOTION_AMOUNT)
	private BigDecimal sellerPromotionAmount;

	/**
	 * order
	 * 应付金额
	 */
	@Table("Ymt_Orders")
	@Column("fPayableAmount")
	@Field(OrderField.PAYABLE_AMOUNT)
	private BigDecimal payableAmount;

	/**
	 * order
	 * 运费
	 */
	@Table("Ymt_Orders")
	@Column("fFreight")
	@Field(OrderField.FREIGHT)
	private BigDecimal freight;

	/**
	 * order
	 * 定金
	 */
	@Table("Ymt_Orders")
	@Column("fOrderPrice")
	@Field(OrderField.ORDER_PRICE)
	private BigDecimal orderPrice;

	/**
	 * order
	 * 价格
	 */
	@Table("Ymt_Orders")
	@Column("fTotalPrice")
	@Field(OrderField.TOTAL_PRICE)
	private BigDecimal totalPrice;

	/**
	 * order
	 * 下单折扣
	 */
	@Table("Ymt_Orders")
	@Column("fOrderDiscount")
	@Field(OrderField.PRE_DISCOUNT)
	private BigDecimal preDiscount;

	/**
	 * order
	 * 补款折扣
	 */
	@Table("Ymt_Orders")
	@Column("fDiscount")
	@Field(OrderField.POST_DISCOUNT)
	private BigDecimal postDiscount;

	/**
	 * order
	 * 地址
	 */
	@Table("Ymt_Orders")
	@Column("sAddress")
	@Field(OrderField.ADDRESS)
	private String address;

	/**
	 * order
	 * 邮编
	 */
	@Table("Ymt_Orders")
	@Column("sPostCode")
	@Field(OrderField.POST_CODE)
	private String postCode;

	/**
	 * order
	 * 收货人
	 */
	@Table("Ymt_Orders")
	@Column("sReceivePerson")
	@Field(OrderField.RECEIVER)
	private String receiver;

	/**
	 * order
	 * 手机
	 */
	@Table("Ymt_Orders")
	@Column("sPhone")
	@Field(OrderField.PHONE)
	private String phone;

	/**
	 * order
	 * 电话
	 */
	@Table("Ymt_Orders")
	@Column("sTelephone")
	@Field(OrderField.TELEPHONE)
	private String telephone;

	/**
	 * order
	 * 邮箱
	 */
	@Table("Ymt_Orders")
	@Column("sEmail")
	@Field(OrderField.EMAIL)
	private String email;

	/**
	 * order
	 * 留言
	 */
	@Table("Ymt_Orders")
	@Column("sLeaveWord")
	@Field(OrderField.COMMENT)
	private String comment;

	/**
	 * order
	 * 能否评价
	 */
	@Table("Ymt_Orders")
	@Column("bCanEvaluate")
	@Field(OrderField.CAN_EVALUATE)
	private boolean canEvaluate;

	/**
	 * order
	 * 订单来源平台
	 */
	@Table("Ymt_OrderExt")
	@Column("sOrderSource")
	@Field(OrderField.PLAT_SOURCE)
	private String platSource;

	/**
	 * order
	 * 需要上传身份证
	 */
	@Table("Ymt_OrderExt")
	@Column("bIsNeedUploadIdCard")
	@Field(OrderField.NEED_UPLOAD_ID_CARD)
	private boolean needUploadIdCard;

	/**
	 * order
	 * 是否已经上传身份证
	 */
	@Table("Ymt_OrderExt")
	@Column("bHaveUploadedIdCard")
	@Field(OrderField.UPLOADED_ID_CARD)
	private boolean uploadedIdCard;

	/**
	 * order
	 * 卖家新客
	 */
	@Table("Ymt_OrderExt")
	@Column("bNewSellerOrder")
	@Field(OrderField.NEW_SELLER)
	private boolean newSeller;

	/**
	 * order
	 * 买家新客
	 */
	@Table("Ymt_OrderExt")
	@Column("bNewCustomerOrder")
	@Field(OrderField.NEW_USER)
	private boolean newUser;

	/**
	 * order
	 * 首单
	 */
	@Table("Ymt_OrderExt")
	@Column("bIsFirstOrder")
	@Field(OrderField.FIRST)
	private boolean first;

	/**
	 * order
	 * 清关国内配送
	 */
	@Table("Ymt_OrderExt")
	@Column("bDeliveredOfChina")
	@Field(OrderField.DELIVERY_CHINA)
	private boolean deliveryChina;

	/**
	 * order
	 * 支付方式
	 */
	@Table("Ymt_TradingInfo")
	@Column("sPayChannel")
	@Field(OrderField.PAY_CHANNEL)
	private String payChannel;

	/**
	 * order
	 * 支付方式
	 */
	@Table("Ymt_TradingInfo")
	@Column("sTradeNo")
	@Field(OrderField.TRADE_NO)
	private String tradeNo;

	/**
	 * order
	 * 取消原因
	 */
	@Table("Ymt_OrderReason")
	@Column("sReason")
	@Field(OrderField.REASON)
	private String reason;

	/**
	 * order
	 * 卖家备注
	 */
	@Table("Ymt_O_OrderNote")
	@Column("sContent")
	@Field(OrderField.CONTENT)
	private String content;

	/**
	 * order
	 * 卖家备注时间
	 */
	@Table("Ymt_O_OrderNote")
	@Column("dAddTime")
	@Field(OrderField.NOTE_TIME)
	private Date noteTime;

	/**
	 * 业务Id
	 */
	@Table("Ymt_OrderBiz")
	@Column("BizId")
	@Field("bizId")
	private String bizId;

	/**
	 * 业务状态
	 */
	@Table("Ymt_OrderBiz")
	@Column("BizStatus")
	@Field("bizSt")
	private Integer bizStatus;

	/**
	 * 业务类型
	 */
	@Table("Ymt_OrderBiz")
	@Column("BizType")
	@Field("bizTp")
	private Integer bizType;

	/**
	 * 业务子类型
	 */
	@Table("Ymt_OrderBiz")
	@Column("BizSubType")
	@Field("bizSubTp")
	private Integer bizSubType;

	/**
	 * fund
	 */
	@Field(OrderField.FUND)
	private Fund fund;

	/**
	 * prds
	 */
	@Field(OrderField.PRODUCTS)
	private List<Product> products;

	/**
	 * rfds
	 */
	@Field(OrderField.REFUNDS)
	private List<Refund> refunds;

	/**
	 * stLog
	 */
	@Field(OrderField.STATUS_LOG)
	private List<StatusLog> statusLog;

	/**
	 * dlv
	 */
	@Field(OrderField.DELIVERY)
	private Delivery delivery;

	@Field("subprds")
	private List<SubProduct> subProducts;
	@Field("mapprds")
	private HashMap<String, List<SubProduct>> mapProducts;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getTimeMongoAdd() {
		return timeMongoAdd;
	}

	public void setTimeMongoAdd(Date timeMongoAdd) {
		this.timeMongoAdd = timeMongoAdd;
	}

	public Date getTimeMongoUpdate() {
		return timeMongoUpdate;
	}

	public void setTimeMongoUpdate(Date timeMongoUpdate) {
		this.timeMongoUpdate = timeMongoUpdate;
	}

	public Long getMainOrderId() {
		return mainOrderId;
	}

	public void setMainOrderId(Long mainOrderId) {
		this.mainOrderId = mainOrderId;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Long getSellerId() {
		return sellerId;
	}

	public void setSellerId(Long sellerId) {
		this.sellerId = sellerId;
	}

	public Date getAddTime() {
		return addTime;
	}

	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}

	public Integer getTradingId() {
		return tradingId;
	}

	public void setTradingId(Integer tradingId) {
		this.tradingId = tradingId;
	}

	public Integer getTradingStatus() {
		return tradingStatus;
	}

	public void setTradingStatus(Integer tradingStatus) {
		this.tradingStatus = tradingStatus;
	}

	public Date getAcceptTime() {
		return acceptTime;
	}

	public void setAcceptTime(Date acceptTime) {
		this.acceptTime = acceptTime;
	}

	public Date getDeliveryTime() {
		return deliveryTime;
	}

	public void setDeliveryTime(Date deliveryTime) {
		this.deliveryTime = deliveryTime;
	}

	public Date getPaidTime() {
		return paidTime;
	}

	public void setPaidTime(Date paidTime) {
		this.paidTime = paidTime;
	}

	public Date getReceiveTime() {
		return receiveTime;
	}

	public void setReceiveTime(Date receiveTime) {
		this.receiveTime = receiveTime;
	}

	public Date getApplyPostTime() {
		return applyPostTime;
	}

	public void setApplyPostTime(Date applyPostTime) {
		this.applyPostTime = applyPostTime;
	}

	public Date getPostTime() {
		return postTime;
	}

	public void setPostTime(Date postTime) {
		this.postTime = postTime;
	}

	public Date getCancelTime() {
		return cancelTime;
	}

	public void setCancelTime(Date cancelTime) {
		this.cancelTime = cancelTime;
	}

	public Integer getRiskStatus() {
		return riskStatus;
	}

	public void setRiskStatus(Integer riskStatus) {
		this.riskStatus = riskStatus;
	}

	public String getUserLogin() {
		return userLogin;
	}

	public void setUserLogin(String userLogin) {
		this.userLogin = userLogin;
	}

	public String getSellerLogin() {
		return sellerLogin;
	}

	public void setSellerLogin(String sellerLogin) {
		this.sellerLogin = sellerLogin;
	}

	public boolean isLocalDelivery() {
		return localDelivery;
	}

	public void setLocalDelivery(boolean localDelivery) {
		this.localDelivery = localDelivery;
	}

	public boolean isDeleted() {
		return deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	public boolean isEvaluated() {
		return evaluated;
	}

	public void setEvaluated(boolean evaluated) {
		this.evaluated = evaluated;
	}

	public boolean isPreSale() {
		return preSale;
	}

	public void setPreSale(boolean preSale) {
		this.preSale = preSale;
	}

	public Integer getRemarkLevel() {
		return remarkLevel;
	}

	public void setRemarkLevel(Integer remarkLevel) {
		this.remarkLevel = remarkLevel;
	}

	public BigDecimal getAutoCancelHour() {
		return autoCancelHour;
	}

	public void setAutoCancelHour(BigDecimal autoCancelHour) {
		this.autoCancelHour = autoCancelHour;
	}

	public boolean isXlobo() {
		return xlobo;
	}

	public void setXlobo(boolean xlobo) {
		this.xlobo = xlobo;
	}

	public BigDecimal getYmtCouponAmount() {
		return ymtCouponAmount;
	}

	public void setYmtCouponAmount(BigDecimal ymtCouponAmount) {
		this.ymtCouponAmount = ymtCouponAmount;
	}

	public String getYmtCouponCode() {
		return ymtCouponCode;
	}

	public void setYmtCouponCode(String ymtCouponCode) {
		this.ymtCouponCode = ymtCouponCode;
	}

	public BigDecimal getSellerCouponAmount() {
		return sellerCouponAmount;
	}

	public void setSellerCouponAmount(BigDecimal sellerCouponAmount) {
		this.sellerCouponAmount = sellerCouponAmount;
	}

	public String getSellerCouponCode() {
		return sellerCouponCode;
	}

	public void setSellerCouponCode(String sellerCouponCode) {
		this.sellerCouponCode = sellerCouponCode;
	}

	public BigDecimal getSellerPromotionAmount() {
		return sellerPromotionAmount;
	}

	public void setSellerPromotionAmount(BigDecimal sellerPromotionAmount) {
		this.sellerPromotionAmount = sellerPromotionAmount;
	}

	public BigDecimal getPayableAmount() {
		return payableAmount;
	}

	public void setPayableAmount(BigDecimal payableAmount) {
		this.payableAmount = payableAmount;
	}

	public BigDecimal getFreight() {
		return freight;
	}

	public void setFreight(BigDecimal freight) {
		this.freight = freight;
	}

	public BigDecimal getOrderPrice() {
		return orderPrice;
	}

	public void setOrderPrice(BigDecimal orderPrice) {
		this.orderPrice = orderPrice;
	}

	public BigDecimal getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(BigDecimal totalPrice) {
		this.totalPrice = totalPrice;
	}

	public BigDecimal getPreDiscount() {
		return preDiscount;
	}

	public void setPreDiscount(BigDecimal preDiscount) {
		this.preDiscount = preDiscount;
	}

	public BigDecimal getPostDiscount() {
		return postDiscount;
	}

	public void setPostDiscount(BigDecimal postDiscount) {
		this.postDiscount = postDiscount;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getPostCode() {
		return postCode;
	}

	public void setPostCode(String postCode) {
		this.postCode = postCode;
	}

	public String getReceiver() {
		return receiver;
	}

	public void setReceiver(String receiver) {
		this.receiver = receiver;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public boolean isCanEvaluate() {
		return canEvaluate;
	}

	public void setCanEvaluate(boolean canEvaluate) {
		this.canEvaluate = canEvaluate;
	}

	public String getPlatSource() {
		return platSource;
	}

	public void setPlatSource(String platSource) {
		this.platSource = platSource;
	}

	public boolean isNeedUploadIdCard() {
		return needUploadIdCard;
	}

	public void setNeedUploadIdCard(boolean needUploadIdCard) {
		this.needUploadIdCard = needUploadIdCard;
	}

	public boolean isUploadedIdCard() {
		return uploadedIdCard;
	}

	public void setUploadedIdCard(boolean uploadedIdCard) {
		this.uploadedIdCard = uploadedIdCard;
	}

	public boolean isNewSeller() {
		return newSeller;
	}

	public void setNewSeller(boolean newSeller) {
		this.newSeller = newSeller;
	}

	public boolean isNewUser() {
		return newUser;
	}

	public void setNewUser(boolean newUser) {
		this.newUser = newUser;
	}

	public boolean isFirst() {
		return first;
	}

	public void setFirst(boolean first) {
		this.first = first;
	}

	public boolean isDeliveryChina() {
		return deliveryChina;
	}

	public void setDeliveryChina(boolean deliveryChina) {
		this.deliveryChina = deliveryChina;
	}

	public String getPayChannel() {
		return payChannel;
	}

	public void setPayChannel(String payChannel) {
		this.payChannel = payChannel;
	}

	public String getTradeNo() {
		return tradeNo;
	}

	public void setTradeNo(String tradeNo) {
		this.tradeNo = tradeNo;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Date getNoteTime() {
		return noteTime;
	}

	public void setNoteTime(Date noteTime) {
		this.noteTime = noteTime;
	}

	public Fund getFund() {
		return fund;
	}

	public void setFund(Fund fund) {
		this.fund = fund;
	}

	public List<Product> getProducts() {
		return products;
	}

	public void setProducts(List<Product> products) {
		this.products = products;
	}

	public List<Refund> getRefunds() {
		return refunds;
	}

	public void setRefunds(List<Refund> refunds) {
		this.refunds = refunds;
	}

	public List<StatusLog> getStatusLog() {
		return statusLog;
	}

	public void setStatusLog(List<StatusLog> statusLog) {
		this.statusLog = statusLog;
	}

	public Delivery getDelivery() {
		return delivery;
	}

	public void setDelivery(Delivery delivery) {
		this.delivery = delivery;
	}

	public String getBizId() {
		return bizId;
	}

	public void setBizId(String bizId) {
		this.bizId = bizId;
	}

	public Integer getBizStatus() {
		return bizStatus;
	}

	public void setBizStatus(Integer bizStatus) {
		this.bizStatus = bizStatus;
	}

	public Integer getBizType() {
		return bizType;
	}

	public void setBizType(Integer bizType) {
		this.bizType = bizType;
	}

	public Integer getBizSubType() {
		return bizSubType;
	}

	public void setBizSubType(Integer bizSubType) {
		this.bizSubType = bizSubType;
	}

	public HashMap<String, List<SubProduct>> getMapProducts() {
		if (this.subProducts != null && this.subProducts.size() != 0) {
			if (this.mapProducts == null || this.mapProducts.size() == 0) {
				this.mapProducts = new HashMap();

				SubProduct subPrd;
				for (Iterator var1 = this.subProducts.iterator(); var1
						.hasNext(); ((List) this.mapProducts.get(subPrd
						.getCatalogId())).add(subPrd)) {
					subPrd = (SubProduct) var1.next();
					if (!this.mapProducts.containsKey(subPrd.getCatalogId())) {
						this.mapProducts.put(subPrd.getCatalogId(),
								new ArrayList());
					}
				}
			}

			return this.mapProducts;
		} else {
			return null;
		}
	}

	@Override
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (!(o instanceof Order))
			return false;

		Order order = (Order) o;

		if (isLocalDelivery() != order.isLocalDelivery())
			return false;
		if (isDeleted() != order.isDeleted())
			return false;
		if (isEvaluated() != order.isEvaluated())
			return false;
		if (isPreSale() != order.isPreSale())
			return false;
		if (isXlobo() != order.isXlobo())
			return false;
		if (isCanEvaluate() != order.isCanEvaluate())
			return false;
		if (isNeedUploadIdCard() != order.isNeedUploadIdCard())
			return false;
		if (isUploadedIdCard() != order.isUploadedIdCard())
			return false;
		if (isNewSeller() != order.isNewSeller())
			return false;
		if (isNewUser() != order.isNewUser())
			return false;
		if (isFirst() != order.isFirst())
			return false;
		if (isDeliveryChina() != order.isDeliveryChina())
			return false;
		if (getId() != null
				? !getId().equals(order.getId())
				: order.getId() != null)
			return false;
		if (getMainOrderId() != null ? !getMainOrderId().equals(
				order.getMainOrderId()) : order.getMainOrderId() != null)
			return false;
		if (getUserId() != null
				? !getUserId().equals(order.getUserId())
				: order.getUserId() != null)
			return false;
		if (getSellerId() != null
				? !getSellerId().equals(order.getSellerId())
				: order.getSellerId() != null)
			return false;
		if (getAddTime() != null
				? !getAddTime().equals(order.getAddTime())
				: order.getAddTime() != null)
			return false;
		if (getTradingId() != null ? !getTradingId().equals(
				order.getTradingId()) : order.getTradingId() != null)
			return false;
		if (getTradingStatus() != null ? !getTradingStatus().equals(
				order.getTradingStatus()) : order.getTradingStatus() != null)
			return false;
		if (getAcceptTime() != null ? !getAcceptTime().equals(
				order.getAcceptTime()) : order.getAcceptTime() != null)
			return false;
		if (getDeliveryTime() != null ? !getDeliveryTime().equals(
				order.getDeliveryTime()) : order.getDeliveryTime() != null)
			return false;
		if (getPaidTime() != null
				? !getPaidTime().equals(order.getPaidTime())
				: order.getPaidTime() != null)
			return false;
		if (getReceiveTime() != null ? !getReceiveTime().equals(
				order.getReceiveTime()) : order.getReceiveTime() != null)
			return false;
		if (getApplyPostTime() != null ? !getApplyPostTime().equals(
				order.getApplyPostTime()) : order.getApplyPostTime() != null)
			return false;
		if (getPostTime() != null
				? !getPostTime().equals(order.getPostTime())
				: order.getPostTime() != null)
			return false;
		if (getCancelTime() != null ? !getCancelTime().equals(
				order.getCancelTime()) : order.getCancelTime() != null)
			return false;
		if (getRiskStatus() != null ? !getRiskStatus().equals(
				order.getRiskStatus()) : order.getRiskStatus() != null)
			return false;
		if (getUserLogin() != null ? !getUserLogin().equals(
				order.getUserLogin()) : order.getUserLogin() != null)
			return false;
		if (getSellerLogin() != null ? !getSellerLogin().equals(
				order.getSellerLogin()) : order.getSellerLogin() != null)
			return false;
		if (getRemarkLevel() != null ? !getRemarkLevel().equals(
				order.getRemarkLevel()) : order.getRemarkLevel() != null)
			return false;
		if (getAutoCancelHour() != null ? !getAutoCancelHour().equals(
				order.getAutoCancelHour()) : order.getAutoCancelHour() != null)
			return false;
		if (getYmtCouponAmount() != null
				? !getYmtCouponAmount().equals(order.getYmtCouponAmount())
				: order.getYmtCouponAmount() != null)
			return false;
		if (getYmtCouponCode() != null ? !getYmtCouponCode().equals(
				order.getYmtCouponCode()) : order.getYmtCouponCode() != null)
			return false;
		if (getSellerCouponAmount() != null
				? !getSellerCouponAmount()
						.equals(order.getSellerCouponAmount()) : order
						.getSellerCouponAmount() != null)
			return false;
		if (getSellerCouponCode() != null
				? !getSellerCouponCode().equals(order.getSellerCouponCode())
				: order.getSellerCouponCode() != null)
			return false;
		if (getSellerPromotionAmount() != null ? !getSellerPromotionAmount()
				.equals(order.getSellerPromotionAmount()) : order
				.getSellerPromotionAmount() != null)
			return false;
		if (getPayableAmount() != null ? !getPayableAmount().equals(
				order.getPayableAmount()) : order.getPayableAmount() != null)
			return false;
		if (getFreight() != null
				? !getFreight().equals(order.getFreight())
				: order.getFreight() != null)
			return false;
		if (getOrderPrice() != null ? !getOrderPrice().equals(
				order.getOrderPrice()) : order.getOrderPrice() != null)
			return false;
		if (getTotalPrice() != null ? !getTotalPrice().equals(
				order.getTotalPrice()) : order.getTotalPrice() != null)
			return false;
		if (getPreDiscount() != null ? !getPreDiscount().equals(
				order.getPreDiscount()) : order.getPreDiscount() != null)
			return false;
		if (getPostDiscount() != null ? !getPostDiscount().equals(
				order.getPostDiscount()) : order.getPostDiscount() != null)
			return false;
		if (getAddress() != null
				? !getAddress().equals(order.getAddress())
				: order.getAddress() != null)
			return false;
		if (getPostCode() != null
				? !getPostCode().equals(order.getPostCode())
				: order.getPostCode() != null)
			return false;
		if (getReceiver() != null
				? !getReceiver().equals(order.getReceiver())
				: order.getReceiver() != null)
			return false;
		if (getPhone() != null ? !getPhone().equals(order.getPhone()) : order
				.getPhone() != null)
			return false;
		if (getTelephone() != null ? !getTelephone().equals(
				order.getTelephone()) : order.getTelephone() != null)
			return false;
		if (getEmail() != null ? !getEmail().equals(order.getEmail()) : order
				.getEmail() != null)
			return false;
		if (getComment() != null
				? !getComment().equals(order.getComment())
				: order.getComment() != null)
			return false;
		if (getPlatSource() != null ? !getPlatSource().equals(
				order.getPlatSource()) : order.getPlatSource() != null)
			return false;
		if (getPayChannel() != null ? !getPayChannel().equals(
				order.getPayChannel()) : order.getPayChannel() != null)
			return false;
		if (getTradeNo() != null
				? !getTradeNo().equals(order.getTradeNo())
				: order.getTradeNo() != null)
			return false;
		if (getReason() != null
				? !getReason().equals(order.getReason())
				: order.getReason() != null)
			return false;
		if (getContent() != null
				? !getContent().equals(order.getContent())
				: order.getContent() != null)
			return false;
		if (getNoteTime() != null
				? !getNoteTime().equals(order.getNoteTime())
				: order.getNoteTime() != null)
			return false;
		if (getFund() != null ? !getFund().equals(order.getFund()) : order
				.getFund() != null)
			return false;
		if (getProducts() != null
				? !getProducts().equals(order.getProducts())
				: order.getProducts() != null)
			return false;
		if (getRefunds() != null
				? !getRefunds().equals(order.getRefunds())
				: order.getRefunds() != null)
			return false;
		if (getStatusLog() != null ? !getStatusLog().equals(
				order.getStatusLog()) : order.getStatusLog() != null)
			return false;
		return getDelivery() != null ? getDelivery()
				.equals(order.getDelivery()) : order.getDelivery() == null;

	}

	@Override
	public int hashCode() {
		int result = getId() != null ? getId().hashCode() : 0;
		result = 31 * result
				+ (getMainOrderId() != null ? getMainOrderId().hashCode() : 0);
		result = 31 * result
				+ (getUserId() != null ? getUserId().hashCode() : 0);
		result = 31 * result
				+ (getSellerId() != null ? getSellerId().hashCode() : 0);
		result = 31 * result
				+ (getAddTime() != null ? getAddTime().hashCode() : 0);
		result = 31 * result
				+ (getTradingId() != null ? getTradingId().hashCode() : 0);
		result = 31
				* result
				+ (getTradingStatus() != null
						? getTradingStatus().hashCode()
						: 0);
		result = 31 * result
				+ (getAcceptTime() != null ? getAcceptTime().hashCode() : 0);
		result = 31
				* result
				+ (getDeliveryTime() != null ? getDeliveryTime().hashCode() : 0);
		result = 31 * result
				+ (getPaidTime() != null ? getPaidTime().hashCode() : 0);
		result = 31 * result
				+ (getReceiveTime() != null ? getReceiveTime().hashCode() : 0);
		result = 31
				* result
				+ (getApplyPostTime() != null
						? getApplyPostTime().hashCode()
						: 0);
		result = 31 * result
				+ (getPostTime() != null ? getPostTime().hashCode() : 0);
		result = 31 * result
				+ (getCancelTime() != null ? getCancelTime().hashCode() : 0);
		result = 31 * result
				+ (getRiskStatus() != null ? getRiskStatus().hashCode() : 0);
		result = 31 * result
				+ (getUserLogin() != null ? getUserLogin().hashCode() : 0);
		result = 31 * result
				+ (getSellerLogin() != null ? getSellerLogin().hashCode() : 0);
		result = 31 * result + (isLocalDelivery() ? 1 : 0);
		result = 31 * result + (isDeleted() ? 1 : 0);
		result = 31 * result + (isEvaluated() ? 1 : 0);
		result = 31 * result + (isPreSale() ? 1 : 0);
		result = 31 * result
				+ (getRemarkLevel() != null ? getRemarkLevel().hashCode() : 0);
		result = 31
				* result
				+ (getAutoCancelHour() != null
						? getAutoCancelHour().hashCode()
						: 0);
		result = 31 * result + (isXlobo() ? 1 : 0);
		result = 31
				* result
				+ (getYmtCouponAmount() != null ? getYmtCouponAmount()
						.hashCode() : 0);
		result = 31
				* result
				+ (getYmtCouponCode() != null
						? getYmtCouponCode().hashCode()
						: 0);
		result = 31
				* result
				+ (getSellerCouponAmount() != null ? getSellerCouponAmount()
						.hashCode() : 0);
		result = 31
				* result
				+ (getSellerCouponCode() != null ? getSellerCouponCode()
						.hashCode() : 0);
		result = 31
				* result
				+ (getSellerPromotionAmount() != null
						? getSellerPromotionAmount().hashCode()
						: 0);
		result = 31
				* result
				+ (getPayableAmount() != null
						? getPayableAmount().hashCode()
						: 0);
		result = 31 * result
				+ (getFreight() != null ? getFreight().hashCode() : 0);
		result = 31 * result
				+ (getOrderPrice() != null ? getOrderPrice().hashCode() : 0);
		result = 31 * result
				+ (getTotalPrice() != null ? getTotalPrice().hashCode() : 0);
		result = 31 * result
				+ (getPreDiscount() != null ? getPreDiscount().hashCode() : 0);
		result = 31
				* result
				+ (getPostDiscount() != null ? getPostDiscount().hashCode() : 0);
		result = 31 * result
				+ (getAddress() != null ? getAddress().hashCode() : 0);
		result = 31 * result
				+ (getPostCode() != null ? getPostCode().hashCode() : 0);
		result = 31 * result
				+ (getReceiver() != null ? getReceiver().hashCode() : 0);
		result = 31 * result + (getPhone() != null ? getPhone().hashCode() : 0);
		result = 31 * result
				+ (getTelephone() != null ? getTelephone().hashCode() : 0);
		result = 31 * result + (getEmail() != null ? getEmail().hashCode() : 0);
		result = 31 * result
				+ (getComment() != null ? getComment().hashCode() : 0);
		result = 31 * result + (isCanEvaluate() ? 1 : 0);
		result = 31 * result
				+ (getPlatSource() != null ? getPlatSource().hashCode() : 0);
		result = 31 * result + (isNeedUploadIdCard() ? 1 : 0);
		result = 31 * result + (isUploadedIdCard() ? 1 : 0);
		result = 31 * result + (isNewSeller() ? 1 : 0);
		result = 31 * result + (isNewUser() ? 1 : 0);
		result = 31 * result + (isFirst() ? 1 : 0);
		result = 31 * result + (isDeliveryChina() ? 1 : 0);
		result = 31 * result
				+ (getPayChannel() != null ? getPayChannel().hashCode() : 0);
		result = 31 * result
				+ (getTradeNo() != null ? getTradeNo().hashCode() : 0);
		result = 31 * result
				+ (getReason() != null ? getReason().hashCode() : 0);
		result = 31 * result
				+ (getContent() != null ? getContent().hashCode() : 0);
		result = 31 * result
				+ (getNoteTime() != null ? getNoteTime().hashCode() : 0);
		result = 31 * result + (getFund() != null ? getFund().hashCode() : 0);
		result = 31 * result
				+ (getProducts() != null ? getProducts().hashCode() : 0);
		result = 31 * result
				+ (getRefunds() != null ? getRefunds().hashCode() : 0);
		result = 31 * result
				+ (getStatusLog() != null ? getStatusLog().hashCode() : 0);
		result = 31 * result
				+ (getDelivery() != null ? getDelivery().hashCode() : 0);
		return result;
	}

}
